package com.rd.student.jiaji.class1.jinhongyu._0712;

public class Student implements Comparable{
    private String name;
    private String major;
    private String className;
    private String describe;
    private int age;
    private int studentID;
    private int studentCount =0;

    public Student(){

    }
    public Student(String name, String zhuanye, String _class, String miaoshu, int age, int studentID){
        this.className = _class;
        this.name = name;
        this.major = zhuanye;
        this.describe = miaoshu;
        this.age = age;
        this.studentID = studentID;
    }
    @Override
    public String toString() {
        return "姓名:"+name+" 班级:"+ className +" 专业:"+ major +" 描述:"+ describe +" 年龄:"+age+" 学号:"+studentID;
    }

    public String getName(){return name;}
    public void  setName(String name){this.name = name;}

    public String getMajor(){return major;}
    public void setMajor(String major){this.major = major;}

    public String get_Class(){return className;}
    public void  set_Class(String _class){this.className = _class;}

    public String getDescribe(){return describe;}
    public void setDescribe(String describe){this.describe = describe;}

    public int getAge(){return age;}
    public void  setAge(int age){this.age = age;}

    public int getStudentID(){return studentID;}
    public void  setStudentID(int studentID){this.studentID = studentID;}


    @Override
    public int compareTo(Object o){
        Student groupnumber = (Student)o;
        if (this.age > groupnumber.age) {
            return 1;
        } else if (this.age < groupnumber.age) {
            return -1;
        }
        return 0;
    }
}
